Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds error handling for themes.svn.wordpress.org request #469

Conversation

creativecoder
Copy link
Contributor

@creativecoder creativecoder commented Nov 6, 2023

Adds error handling so that if the request to themes.svn.wordpress.org to check theme names fails for some reason, the request fails gracefully and outputs the error to the JS console.

Testing instructions

  • Spoof an error when making request to themes.svn.wordpress.org, e.g. add domain to /etc/hosts file or manually return a WP_Error from WP_Theme_Directory::get_theme_names
  • See that the with this change, the error is logged to the JS console, rather than being unhandled.

Copy link
Contributor

@pbking pbking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised

@creativecoder
Copy link
Contributor Author

Thanks for the review @pbking !

@creativecoder creativecoder merged commit ed24804 into WordPress:trunk Nov 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants